import http from '../utils/request'
import Vue from 'vue'

let user = async (checkId) => {
    return await http.get('/user').then(res => {
        return res.data
    })
}

let role = async (checkId) => {
    return await http.get('/s_role_code').then(res => {
        return res.data
    })
}

let create = async (file) => {
    return await http.post('/api/module', file).then(res => {
        return res.data
    })
}

let updataModule = async (file) => {
    return await http.post('/api/module/update', file).then(res => {
        return res.data
    })
}

let getBpmnInfo = async (bpmnId) => {
    return await http.get(`/api/module/${bpmnId}/bpmn`).then(res => {
        return res.data
    })
}

let getModalInfo = async (bpmnId) => {
    return await http.get(`api/module/${bpmnId}`).then(res => {
        return res.data
    })
}

export {
    user,
    role,
    create,
    getBpmnInfo,
    getModalInfo,
    updataModule
}